View Javadoc
1 package jrre.instructionset.push.localvariables; 2 3 import jrre.*; 4 import jrre.types.*; 5 6 public class IALoad extends jrre.instructionset.Instruction { 7 8 public IALoad(){ 9 10 name = "iaload"; 11 description = "foo"; 12 length = 0; 13 } 14 15 /*** 16 * Executes the <strong><code>iaload</code></strong> instruction. 17 * 18 * @param operandStack 19 */ 20 public void execute(){ 21 22 23 PrimitiveType index = (PrimitiveType)Stack.popOperand(); 24 ReferenceType arrayRef = (ReferenceType)Stack.popOperand(); 25 26 ArrayInstance array = (ArrayInstance)arrayRef.getValue(); 27 28 //System.out.println("IALoad array: "+array+" IALoad index: "+index.getValue()); 29 Stack.pushOperand(array.getElement(index.getValue())); 30 } 31 32 public String toString(){ 33 StringBuffer toReturn = new StringBuffer(); 34 toReturn.append("iaload "); 35 return toReturn.toString(); 36 } 37 }

This page was automatically generated by Maven